package file;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;

/**
 * Created with IntelliJ IDEA
 * Description
 * User：chenshu
 * Date：2023-11-15
 * Time：22:52
 */
public class Demo5 {
    public static void main(String[] args) {
        try(OutputStream outputStream = new FileOutputStream("test.txt")) {
//            outputStream.write('h');
//            outputStream.write('e');
//            outputStream.write('l');
//            outputStream.write('l');
//            outputStream.write('o');
            String s = "hello file write";
            outputStream.write(s.getBytes());
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
